package com.bbx.taxi.client.Adapter.Plane;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.bbx.androidapi.util.DensityUtil;
import com.bbx.taxi.official.R;
import com.bbx.taxi.client.Activity.Address.AddAddressActivity;
import com.bbx.taxi.client.Activity.Menu.SetActivity;
import com.bbx.taxi.client.Adapter.Plane.FlightDetaileAdapter.ViewHolder;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Handler;
import android.os.Message;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

/**
 * 航班号的具体信息
 */
public class FlightNumberAdapter extends BaseAdapter {
	private List<String> list;
	private Activity main;

	public FlightNumberAdapter(Activity context, List<String> list) {
		this.list = list;
		main = context;
	}

	@Override
	public int getCount() {
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		return list.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;

	}

	@Override
	public View getView(final int position, View convertView, ViewGroup parent) {
		ViewHolder viewholder;
		if (convertView == null) {
			LayoutInflater inflater = LayoutInflater.from(main);
			convertView = (View) inflater.inflate(R.layout.item_flight_number,
					null);
			viewholder = new ViewHolder();
			viewholder.tv_number = (TextView) convertView
					.findViewById(R.id.tv_number);
			convertView.setTag(viewholder);
		} else
			viewholder = (ViewHolder) convertView.getTag();
		viewholder.tv_number.setText(list.get(position));
		return convertView;

	}

	public class ViewHolder {
		TextView tv_number;
	}
}
